package com.ln.testdrag;

import android.view.View;

/**
 *    desc   : {@link View.OnClickListener} 包装类
 */
@SuppressWarnings("rawtypes")
public final class ViewClickWrapper implements View.OnClickListener {

    private final FloatWindow<?> mFloatWindow;
    private final FloatWindow.OnClickListener mListener;

    ViewClickWrapper(FloatWindow<?> floatWindow, FloatWindow.OnClickListener listener) {
        mFloatWindow = floatWindow;
        mListener = listener;
    }

    @SuppressWarnings("unchecked")
    @Override
    public void onClick(View view) {
        if (mListener == null) {
            return;
        }
        mListener.onClick(mFloatWindow, view);
    }
}